home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / Tele / M / Microphone Quotes / Ask Date next >
Encoding:
Text File  |  1991-04-19  |  3.1 KB  |  86 lines  |  [TEXT/ttxt]

  1.  Settings File = GEnie
  2.  Script Name = Ask Date
  3.  Command Key = 
  4.  F-Key = 
  5.  Menu = NO
  6.  Button = NO
  7.  Version = 3007
  8.  System = Macintosh
  9.  
  10. 1   Remark "Microphone II Script to ask user for date and check format is yymmdd"
  11. 2   Remark "Written by Melvyn D. Magree, (M)agreeable software, inc."
  12. 3   Remark ""
  13. 4   Remark "On entrance, StartEnd should be 'Start' or 'End' for type of date"
  14. 5   Remark "Returns date entered as GivenDate"
  15. 6   Remark "GivenDate is null string if user gives up on entering correct date format"
  16. 7   Remark ""
  17. 8   Remark "Latest update of this script - 91-04-18"
  18. 9   Remark ""
  19. 10  Set Variable * GivenDate from Expression "'*'"
  20. 11  Set Variable * CurrentDate from Expression "Mid(String(Year),3,2)&Mid(String(Month+100),2,2)&Mid(String(Day+100),2,2)"
  21. 12  Repeat
  22. 13   Set Variable * AskDate from Dialog Box "'Enter '&StartEnd&' Date in form YYMMDD'"
  23. 14   If Expression "AskDate=''"
  24. 15    Set Variable * GivenDate from Expression "AskDate"
  25. 16    Leave
  26. 17   Else If Expression "Length(AskDate)=6"
  27. 18    If Expression "AskDate>CurrentDate"
  28. 19     Alert * OK/Abort "'Date must be less than or equal today - '&CurrentDate"
  29. 20     If Success
  30. 21      Cycle
  31. 22     Else
  32. 23      Abort Script
  33. 24     End If
  34. 25    End If
  35. 26    Set Variable * StartYear from Expression "Number(Mid(AskDate,1,2))"
  36. 27    Set Variable * StartMonth from Expression "Number(Mid(AskDate,3,2))"
  37. 28    Set Variable * StartDay from Expression "Number(Mid(AskDate,5,2))"
  38. 29    Set Variable * DayRange from Expression "0"
  39. 30    If Expression "((1900+StartYear)<(Year-1)) or ((1900+StartYear)>Year)"
  40. 31     Alert * OK/Abort "'Year must be '&string(Year-1901)&' or '&string(Year-1900)"
  41. 32     If Failure
  42. 33      Abort Script
  43. 34     End If
  44. 35    Else If Expression "(StartMonth<1) or (StartMonth>12)"
  45. 36     Alert * OK/Abort "'Month must be 1 to 12'"
  46. 37     If Failure
  47. 38      Abort Script
  48. 39     End If
  49. 40    Else If Expression "(StartMonth=4) or (StartMonth=6) or (StartMonth=9) or (StartMonth=11) "
  50. 41     If Expression "(StartDay>0) and (StartDay<31)"
  51. 42      Set Variable * GivenDate from Expression "AskDate"
  52. 43     Else
  53. 44      Set Variable * DateRange from Expression "30"
  54. 45     End If
  55. 46    Else If Expression "StartMonth=2"
  56. 47     If Expression "(StartYear=0) or (StartYear Mod 4 <> 0)"
  57. 48      Set Variable * DaysInFeb from Expression "28"
  58. 49     Else
  59. 50      Set Variable * DaysInFeb from Expression "29"
  60. 51     End If
  61. 52     If Expression "(StartDay>0) and (StartDay<DaysInFeb)"
  62. 53      Set Variable * GivenDate from Expression "AskDate"
  63. 54     Else
  64. 55      Set Variable * DateRange from Expression "DaysInFeb"
  65. 56     End If
  66. 57    Else
  67. 58     If Expression "(StartDay>0) and (StartDay<32)"
  68. 59      Set Variable * GivenDate from Expression "AskDate"
  69. 60     Else
  70. 61      Set Variable * DayRange from Expression "31"
  71. 62     End If
  72. 63    End If
  73. 64    If Expression "DayRange>0"
  74. 65     Alert * OK/Abort "'Day must be 1 to '&string(DayRange)"
  75. 66     If Failure
  76. 67      Abort Script
  77. 68     End If
  78. 69    End If
  79. 70   Else
  80. 71    Alert * OK/Abort "'Enter date in form yymmdd.  For example, 910322 for 22 March 1991.'"
  81. 72    If Failure
  82. 73     Abort Script
  83. 74    End If
  84. 75   End If
  85. 76  Until Expression "GivenDate<>'*'"
  86.